from django.contrib import admin
from .models import Movie, MovieImage, MovieLink

class MovieImageInline(admin.TabularInline):
    model = MovieImage
    extra = 1

class MovieLinkInline(admin.TabularInline):
    model = MovieLink
    extra = 1

@admin.register(Movie)
class MovieAdmin(admin.ModelAdmin):
    inlines = [MovieImageInline, MovieLinkInline]
    list_display = ('title', 'director', 'release_year', 'rating')
    search_fields = ('title', 'director')
    list_filter = ('genre', 'release_year')

admin.site.register(MovieImage)
admin.site.register(MovieLink)
